const all = require('require-dir')();

export const schema = [];
export const queries = {};
export const mutations = {};
export const connectors = {};

let q = '';
let m = '';

for (const name in all) {
    const module = all[name];
    schema.push(module.default);
    Object.assign(queries, module.queries);
    Object.assign(mutations, module.mutations);
    Object.assign(connectors, module.connectors);
    if (module.queryDefs) q += module.queryDefs;
    if (module.mutationDefs) m += module.mutationDefs;
}

export const queryDefs = q;
export const mutationDefs = m;
